﻿<%namespace YouHP.Model%>
<%namespace YouHP.Utility%>
<%template _header%>
<script type="text/javascript" src="/support/swfobject/open-flash-chart.js"></script>
<script type="text/javascript" src="/support/swfobject/xiaochuan.js"></script>
<script type="text/javascript" src="/support/My97DatePicker/WdatePicker.js"></script>
<div class="layout-cols2">
<%template _memmenu%>
	<div class="pannelcontent">

		<div class="pcontent">
		<div class="panneldetail">
	     <%template _memrecordermenu%>
	     	
			<div class="pannelbody">
	    <div class="box">
            <div class="caption">
               哮喘的控制程度
            </div>
            <div class="content">
                <div id="xiaochuanchart1"></div>
                 <script type="text/javascript">
                     swfobject.embedSWF("/support/swfchart/open-flash-chart.swf", "xiaochuanchart1", "740", "250", "9.0.0", "expressInstall.swf", { 'id': '1', 'flashready': 'OnXiaoChuanFlashReady' }, { wmode: "transparent" });
                </script>
            </div>
        </div>
	    
	    <div class="box">
	        <div class="caption">
	            填写数据
	        </div>
	        <div class="content">
	            <br />
	            <div style="width:700px; padding-bottom:10px;">
	            选择时间：
	             <%csharp%>
	                     string sNow = DateTime.Now.ToString("yyyy-MM-dd"); 
	             <%/csharp%>
	            <input class="box-var validate-date" id="date" maxlength="10" size="10" name="date" value="{sNow}" style="vertical-align:middle;"/>
                    <a class="no-hover" id="buttonDate" title="Click on this to open the calendar, Use the arrow keys to move through dates" style="vertical-align:middle"  href="#">
                        <img class="icon-cal" alt="日期" src="/support/alpha/images/calendar/calendar-icon_calendar.png" />
                    </a>
                    <script type="text/javascript">
                         Calendar.setup({inputField: 'date', ifFormat: '%Y-%m-%d', button: 'buttonDate'}) 
                    </script>
                    <em class="helptext">格式：年-月-日(1970-03-08)</em>
                <table style="width:680px;padding-bottom:10px;"">
                    <tr>
                        <td colspan="6">1. 在过去4周内，在工作、学习或家中，有多少时候哮喘妨碍您进行日常活动？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_1_1" name="indicator1" value="1"/>所有时间</td>
                        <td><input type="radio" id="ID_INDICATOR_1_2" name="indicator1" value="2"/>大多数时间</td>
                        <td><input type="radio" id="ID_INDICATOR_1_3" name="indicator1" value="3"/>有些时间</td>
                        <td><input type="radio" id="ID_INDICATOR_1_4" name="indicator1" value="4"/>很少时间</td>
                        <td><input type="radio" id="ID_INDICATOR_1_5" name="indicator1" value="5"/>没有</td>
                    </tr>
                    <tr>
                        <td colspan="6">2. 在过去4周内，您有多少次呼吸困难？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_2_1" name="indicator2" value="1"/>每天不止1次</td>
                        <td><input type="radio" id="ID_INDICATOR_2_2" name="indicator2" value="2"/>每天1次</td>
                        <td><input type="radio" id="ID_INDICATOR_2_3" name="indicator2" value="3"/>每周3至6次</td>
                        <td><input type="radio" id="ID_INDICATOR_2_4" name="indicator2" value="4"/>每周1至2次</td>
                        <td><input type="radio" id="ID_INDICATOR_2_5" name="indicator2" value="5"/>完全没有</td>
                    </tr>
                    <tr>
                        <td colspan="6">3. 在过去4周内，因为哮喘症状（喘息、咳嗽、呼吸困难、胸闷或疼痛）， 您有多少次在夜间醒来   或早上比平时早醒？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_3_1" name="indicator3" value="1"/>每周4晚或更多</td>
                        <td><input type="radio" id="ID_INDICATOR_3_2" name="indicator3" value="2"/>每周2至3晚 </td>
                        <td><input type="radio" id="ID_INDICATOR_3_3" name="indicator3" value="3"/>每周1次</td>
                        <td><input type="radio" id="ID_INDICATOR_3_4" name="indicator3" value="4"/>1至2次</td>
                        <td><input type="radio" id="ID_INDICATOR_3_5" name="indicator3" value="5"/>没有</td>
                    </tr>
                    <tr>
                        <td colspan="6">4. 在过去4周内，您有多少次使用急救药物治疗（如沙丁胺醇）？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_4_1" name="indicator4" value="1"/>每天3次以上</td>
                        <td><input type="radio" id="ID_INDICATOR_4_2" name="indicator4" value="2"/>每天1至2次 </td>
                        <td><input type="radio" id="ID_INDICATOR_4_3" name="indicator4" value="3"/>每周2至3次</td>
                        <td><input type="radio" id="ID_INDICATOR_4_4" name="indicator4" value="4"/>每周1次或更少</td>
                        <td><input type="radio" id="ID_INDICATOR_4_5" name="indicator4" value="5"/>没有</td>
                    </tr>
                    <tr>
                        <td colspan="6">5. 您如何评价过去4周内，您的哮喘控制情况？</td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td><input type="radio" id="ID_INDICATOR_5_1" name="indicator5" value="1"/>没有控制</td>
                        <td><input type="radio" id="ID_INDICATOR_5_2" name="indicator5" value="2"/>控制很差</td>
                        <td><input type="radio" id="ID_INDICATOR_5_3" name="indicator5" value="3"/>有所控制</td>
                        <td><input type="radio" id="ID_INDICATOR_5_4" name="indicator5" value="4"/>控制很好</td>
                        <td><input type="radio" id="ID_INDICATOR_5_5" name="indicator5" value="5"/>完全控制</td>
                    </tr>
                    <tr>
                        <td colspan="6" align="center"><input type="button" onclick="OnAddHistory();" value="提交"/></td>
                    </tr>
                </table>
	            </div>
	         </div>
	    </div>
	         <div class="box">
	            <div class="caption">
	                填写历史数据
	            </div>
	            <!--TP.LIST 
                   <%HD%><table ID="ID_TABLE" border="0" cellpadding="0" cellspacing="0" class="tbl-data" style="width:700px;">
	                <thead>
	                <tr>
	                    <th style="width:200px;">日期</th>
	                    <th style="width:160px;text-align:left">情况</th>
	                    <th  style="text-align:left">操作</th>
	                </tr>
	                </thead>
				    <%LB%><%EB%>
                    <tr>    
                        <td><%date%></td>
                        <td style="text-align:left"><%value%></td>
                        <td style="text-align:left">
                            <a href="javascript:OnDelHistory(<%id%>)" onclick='return confirm("确定要删除吗?")' class="selectall">删除</a>
                            <a href="historyedit.aspx?id=<%id%> " class="selectall">修改</a>
                        </td>
                    </tr>
                    <%EE%>                                     
                    <%LE%>
                    <%TL%>
                </table> 
                TP.LIST-->
                <br />
              <div id="XiaoChuan_list" style="width:700px"></div>
              <div id="page" style="width:700px"><p id="ID_page"></p></div> 
	    </div>
	</div>
	</div>
	</div>
	</div>
	
</div>

<script type="text/javascript">
function gettypevalue() {
    function check(index) {
        for (var i = 1; i <= 5; ++i)
            if (_$("ID_INDICATOR_"+index+"_" + i).checked) return i;
        return -1;
    }
    var types = [];
    for (var i = 1; i <= 5; ++i) {
        types.push(check(i));
    }
    return types;
}
function OnAddHistory(){
    var surl="/pages/alpha/XiaoChuanHistory/XiaoChuanUpdate.aspx?type=0";
    var date = _$("date").value;
    var typevalues = gettypevalue();
    var index = typevalues.find(-1);
   
    if (index != null) {
        alert("请选择第" + (index+1) + "项");
        return;
    }
    var value = typevalues.join(',');
    surl = surl+"&&date="+date.escUrl()+"&&value="+value ;
    function OnSuc(xmlDoc)
    {
        alert("添加数据成功");
        window.location.href = window.location.href;
    }
    function OnFail(xmlDoc)
    {
        var result = xmlDoc.getElementsByTagName("result")[0];
        retCode = result.getAttribute("code");
        retMsg = result.getAttribute("msg");
        if ( -200 == retCode)
        {
            if( window.confirm(retMsg) )
            {
                surl +="&force=1"
                getResultXml(surl,OnSuc,OnFail,OnFail); 
            }
        }
        else
        {
            alert(retMsg);
        }
    }
    function OnError()
    {
        alert("操作失败，请稍后再试");
    }
    getResultXml(surl,OnSuc,OnFail,OnError);
}
function OnDelHistory(id) {
    var surl = "/pages/alpha/XiaoChuanHistory/XiaoChuanUpdate.aspx?type=2&id="+id;
    function OnSuc(xmlDoc) {
        alert("操作成功");
        window.location.href = window.location.href;
    }
    function OnFail(xmlDoc) {
        var result = xmlDoc.getElementsByTagName("result")[0];
        retMsg = result.getAttribute("msg");
        alert(retMsg);
    }
    function OnError() {
        alert("操作失败，请稍后再试");
    }
    getResultXml(surl, OnSuc, OnFail, OnError);
}
</script>
<%template _footer%>
